package com.jianyi.common;

import java.io.Serializable;
import java.util.List;

public class AjaxResponse<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    private List<String> errors;
    private List<String> warnings;
    private T data;

    /**
     * 0-failed, 1-success, 2-success with warnings.
     */
    private Integer status;
    private String message;

    public AjaxResponse() {
    }


    public AjaxResponse(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    public AjaxResponse(Integer status,  String message,T data) {
        this.data = data;
        this.status = status;
        this.message = message;
    }
    public AjaxResponse(Integer status) {
        this.message = message;
    }
    public List<String> getErrors() {
        return errors;
    }

    public void setErrors(List<String> errors) {
        this.errors = errors;
    }

    public List<String> getWarnings() {
        return warnings;
    }

    public void setWarnings(List<String> warnings) {
        this.warnings = warnings;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
